package com.nantong.admin.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.nantong.admin.domain.SysUserRole;
import com.nantong.admin.domain.model.response.role.SysRoleVo;
import com.nantong.common.mybatis.core.mapper.BaseMapperPlus;

/**
 * 用户与角色关联表 数据层
 *
 * @author nantong
 */
@Mapper
public interface SysUserRoleMapper extends BaseMapperPlus<SysUserRole, SysRoleVo> {

    /**
     * 查询用户所属角色ID列表
     *
     * @param userId 用户ID
     * @return 角色ID列表
     */
    @Select("SELECT role_id FROM sys_user_role WHERE user_id = #{userId}")
    List<Long> selectRoleIdsByUserId(@Param("userId") Long userId);
}
